﻿using System.Linq;
using System.Windows.Controls;

using NetBay.Core.BusinessEntities;

using Rio.Manager.Application.ViewModel.GeneralTabs;

namespace Rio.Manager.Application.Views
{
    /// <summary>
    /// Description for DashboardTabView.
    /// </summary>
    public partial class DashboardTabView : UserControl
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the DashboardTabView class.
        /// </summary>
        public DashboardTabView()
        {
            InitializeComponent();
        }

        #endregion Constructors

        #region Methods

        /// <summary>
        /// Handles the SelectionChanged event of the radGridView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Windows.Controls.SelectionChangeEventArgs"/> instance containing the event data.</param>
        private void radGridView_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
        {
            (DataContext as DashboardTabViewModel).SelectedOperators = new System.Collections.ObjectModel.ObservableCollection<NumerizationOperator>(radGridView.SelectedItems.Cast<NumerizationOperator>());
        }

        #endregion Methods
    }
}